<style lang="less">
    @import "applyCustomerDetail.less";
</style>
<template>
    <div class="customer">
        <Card style="width:100%" shadow>
            <Collapse v-model="values">
                <Panel name="1">
                    基本信息
                    <div slot="content">
                        <Row>
                            <Button @click="saveMainInfo" style="float: right" type="success" v-if="isCheck">保存</Button>
                        </Row>
                        <Form ref="mainBaseInfo" :label-width="160" :model="mainBaseInfo" :rules="mainBaseInfoValidate" label-position="right"  inline >
                            <Row>
                                <Col span="8">
                                    <FormItem prop="custName" label="客户姓名">
                                        <Input type="text" v-model="mainBaseInfo.custName" disabled placeholder="请输入">
                                        </Input>
                                    </FormItem>
                                </Col>
                                <Col span="16">
                                    <FormItem prop="spellName" label="拼音/英文" >
                                        <Input type="text" v-model="mainBaseInfo.spellName" disabled placeholder="请输入">
                                        </Input>
                                    </FormItem>
                                </Col>
                            </Row>
                            <Row>
                                <Col span="8">
                                    <FormItem prop="certType" label="证件类型">
                                        <Select style="width: 150px" v-model="mainBaseInfo.certType" disabled placeholder="请选择">
                                            <Option v-for="item in dataDic.certType" :label="item.title" :value="item.value" :key="item.value">{{ item.title }}</Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                                <Col span="16">
                                    <FormItem prop="certNo" label="证件号码" >
                                        <Input type="text" v-model="mainBaseInfo.certNo" disabled placeholder="请输入">
                                        </Input>
                                    </FormItem>
                                </Col>
                            </Row>
                            <Row>
                                <Col span="8">
                                    <FormItem prop="birthday" label="出生日期">
                                        <DatePicker type="date" v-model="mainBaseInfo.birthday" disabled placeholder="选择日期"></DatePicker>
                                    </FormItem>
                                </Col>
                                <Col span="8">
                                    <FormItem prop="certEndDate" label="证件到期日">
                                        <DatePicker type="date" v-model="mainBaseInfo.certEndDate" disabled placeholder="选择日期"></DatePicker>
                                    </FormItem>
                                </Col>
                                <Col span="8">
                                    <FormItem prop="isLongTerm" label="是否长期有效">
                                        <Select style="width: 150px" v-model="mainBaseInfo.isLongTerm" disabled placeholder="请选择">
                                            <Option v-for="item in dataDic.isType" :label="item.title" :value="item.value" :key="item.value">{{ item.title }}</Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                            </Row>
                            <Row>
                                <Col span="8">
                                    <FormItem prop="age" label="年龄">
                                        <Input type="text" v-model="mainBaseInfo.age" disabled placeholder="请输入">
                                        </Input>
                                    </FormItem>
                                </Col>
                                <Col span="8">
                                    <FormItem prop="zodiac" label="生肖">
                                        <RadioGroup v-model="mainBaseInfo.zod">
                                            <Radio v-for="item in mainBaseInfo.zodiacList" :label="item" disabled></Radio>
                                        </RadioGroup>
                                    </FormItem>
                                </Col>
                                <Col span="8">
                                    <FormItem prop="maritalStatus" label="婚姻状况">
                                        <Select  style="width: 150px" v-model="mainBaseInfo.maritalStatus" :disabled="!isCheck" placeholder="请选择">
                                            <Option  v-for="item in dataDic.maritalStatus" :label="item.title" :value="item.value" :key="item.value">{{ item.title }}</Option>
                                        </Select>
                                        <span :class="mainBaseInfo.maritalStatus+'' !== mainBaseInfo.maritalStatusOld+'' ? 'red' : ''" v-show="mainBaseInfo.maritalStatus+'' !== mainBaseInfo.maritalStatusOld+''&&mainBaseInfo.maritalStatusOld!==''">
                                                {{setMaritalStatusTitle(mainBaseInfo.maritalStatusOld)}}
                                        </span>
                                    </FormItem>
                                </Col>
                            </Row>
                            <Row>
                                <Col span="8">
                                    <FormItem prop="sex" label="性别">
                                        <Select style="width: 150px" v-model="mainBaseInfo.sex" disabled placeholder="请选择">
                                            <Option v-for="item in dataDic.sex" :label="item.title" :value="item.value" :key="item.value">{{ item.title }}</Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                                <Col span="8">
                                    <FormItem prop="nationality" label="国籍">
                                        <Select style="width: 150px" v-model="mainBaseInfo.nationality" disabled placeholder="请选择">
                                            <Option v-for="item in dataDic.nationality" :label="item.title" :value="item.value" :key="item.value">{{ item.title }}</Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                                <Col span="8">
                                    <FormItem prop="workAge" label="工作年限">
                                        <Input type="text" v-model="mainBaseInfo.workAge" :disabled="!isCheck" placeholder="请输入">
                                        </Input>
                                    </FormItem>
                                </Col>
                            </Row>
                            <Row>
                                <Col span="8">
                                    <FormItem prop="census" label="户籍所在地">
                                        <i-select style="width: 150px" v-model="mainBaseInfo.province" placement="top" placeholder="请选择" @on-change="queryMainCity" :disabled="!isCheck">
                                            <i-option v-for="(item,index) in provinces" style="width: 150px" :label="item.label" :value="item.value" :key="index">{{ item.label }}</i-option>
                                        </i-select>
                                        <Select style="width: 150px" v-model="mainBaseInfo.city" placement="top" placeholder="请选择" :disabled="!isCheck">
                                            <Option v-for="(item,index) in mainCities" style="width: 150px" :label="item.label" :value="item.value" :key="index">{{ item.label }}</Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                                <Col span="8" >
                                    <FormItem prop="telPhone" label="手机号码" >
                                        <div style="display: flex; flex-flow: row;">
                                            <Poptip placement="bottom" v-if="this.backSign==='yes'&&mainBaseInfo.telPhone!==mainBaseInfo.telPhoneOld" >
                                                <Input type="text" v-model="mainBaseInfo.telPhone" disabled placeholder="请输入" icon="ios-warning">
                                                </Input>
                                                <div slot="title" style="font-weight: 700">{{mainBaseInfo.telPhoneOld}}</div>
                                            </Poptip>
                                            <Input v-if="this.backSign!=='yes'||mainBaseInfo.telPhone===mainBaseInfo.telPhoneOld" type="text" v-model="mainBaseInfo.telPhone" disabled placeholder="请输入">
                                            </Input>
                                            <Button style="margin-left:5px;" type="success" v-if="isCheck" size="small" @click="callPhone(mainBaseInfo.telPhone,'',mainBaseInfo.id,mainBaseInfo.custName)"  icon="md-call" >
                                            </Button>
                                            <Button style="margin-left:5px;" v-if="isCheck" type="success" size="small" @click="getMsgTemp(mainBaseInfo.custName,mainBaseInfo.telPhone,'01')" icon="md-mail" >
                                            </Button>
                                        </div>
                                    </FormItem>
                                </Col>
                                <Col span="8">
                                    <FormItem prop="licenceType" label="驾驶证件类型">
                                        <Select style="width: 150px" v-model="mainBaseInfo.drivingType" :disabled="!isCheck" placeholder="请选择">
                                            <Option v-for="item in dataDic.drivingType" :label="item.title" :value="item.value" :key="item.value">{{ item.title }}</Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                            </Row>
                            <Row>
                                <Col span="8">
                                    <FormItem prop="highestEducation" label="学历">
                                        <Select style="width: 150px" v-model="mainBaseInfo.highestEducation" :disabled="!isCheck" placeholder="请选择">
                                            <Option v-for="item in dataDic.highestEducation" :label="item.title" :value="item.value" :key="item.value">{{ item.title }}</Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                                <Col span="8">
                                    <FormItem prop="newPhone" label="新增号码">
                                        <Input type="text" maxlength="11" v-model="mainBaseInfo.newPhone" :disabled="!isCheck" placeholder="请输入">
                                        </Input>
                                    </FormItem>
                                </Col>
                                <Col span="8">
                                    <FormItem prop="drivingLicenceNo" label="驾驶证档案编号">
                                        <Input type="text" v-model="mainBaseInfo.drivingLicenceNo" :disabled="!isCheck" placeholder="请输入">
                                        </Input>
                                    </FormItem>
                                </Col>
                            </Row>
                        </Form>
                    </div>
                </Panel>
                <Panel name="2">
                    工作信息
                    <div slot="content">
                        <Row>
                            <Button @click="saveWorkInfo" style="float: right" type="success" v-if="isCheck">保存</Button>
                        </Row>
                        <Form ref="mainWorkInfo" :model="mainWorkInfo" label-position="right" :rules="mainWorkInfoValidate" :label-width="160" inline >
                            <Row>
                                <Col span="8">
                                    <FormItem prop="unitName" label="单位名称">
                                        <Poptip placement="bottom" v-if="this.backSign==='yes'&&mainWorkInfo.unitName!==mainWorkInfo.unitNameOld&&mainWorkInfo.unitNameOld!=='undefined'" >
                                            <Input type="text" v-model="mainWorkInfo.unitName" :disabled="!isCheck" placeholder="请输入" icon="ios-warning">
                                            </Input>
                                            <div slot="title" style="font-weight: 700">{{mainWorkInfo.unitNameOld}}</div>
                                        </Poptip>
                                        <Input v-if="this.backSign!=='yes'||mainWorkInfo.unitName===mainWorkInfo.unitNameOld||(this.backSign==='yes'&&commomCustInfo.unitNameOld==='undefined')" type="text" v-model="mainWorkInfo.unitName" :disabled="!isCheck" placeholder="请输入">
                                        </Input>
                                    </FormItem>
                                </Col>
                                <Col span="8">
                                    <FormItem prop="unitType" label="单位性质">
                                        <Select style="width: 150px" v-model="mainWorkInfo.unitType" disabled placeholder="请选择">
                                            <Option v-for="item in dataDic.unitNature" :label="item.title" :value="item.value" :key="item.value">{{ item.title }}</Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                                <Col span="8">
                                    <FormItem prop="industryType" label="行业类型">
                                        <Select style="width: 150px" v-model="mainWorkInfo.industryType" :disabled="!isCheck" placeholder="请选择">
                                            <Option v-for="item in dataDic.industryType" :label="item.title" :value="item.value" :key="item.value">{{ item.title }}</Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                            </Row>
                            <Row>
                                <Col span="8">
                                    <FormItem prop="professionalType" label="职业类型">
                                        <Select  style="width: 150px" v-model="mainWorkInfo.professionalType" :disabled="!isCheck" placeholder="请选择">
                                            <Option v-for="item in dataDic.jobsType" :label="item.title" :value="item.value" :key="item.value">{{ item.title }}</Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                                <Col span="8">
                                    <FormItem prop="position" label="职务">
                                        <Select style="width: 150px" v-model="mainWorkInfo.position" :disabled="!isCheck" placeholder="请选择">
                                            <Option v-for="item in dataDic.position" :label="item.title" :value="item.value" :key="item.value">{{ item.title }}</Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                                <Col span="8">
                                    <FormItem prop="unitTelPhone" label="公司电话">
                                        <Input type="text" v-model="mainWorkInfo.unitTelPhone" :disabled="!isCheck" placeholder="请输入">
                                        </Input>
                                        <Button style="margin-left:5px;" type="success" size="small"  @click="isCallOut=true" icon="md-call" v-show="isCheck">
                                        </Button>
                                    </FormItem>
                                </Col>
                            </Row>
                            <Row>

                                <Col span="8">
                                    <FormItem prop="monthlyIncome" label="本人月收入">
                                        <Input type="text" v-model="mainWorkInfo.monthlyIncome" :disabled="!isCheck" placeholder="请输入">
                                        </Input>
                                    </FormItem>
                                </Col>
                                <Col span="8">
                                    <FormItem prop="familyIncome" label="家庭总收入">
                                        <Input type="text" v-model="mainWorkInfo.familyIncome" :disabled="!isCheck" placeholder="请输入">
                                        </Input>
                                    </FormItem>
                                </Col>
                                <Col span="8">
                                    <FormItem prop="outstandingLoan" label="未结清贷款">
                                        <Input type="text" v-model="mainWorkInfo.outstandingLoan" :disabled="!isCheck" placeholder="请输入">
                                        </Input>
                                    </FormItem>
                                </Col>
                            </Row>
                        </Form>
                    </div>
                </Panel>
                <Panel name="3">
                    地址信息
                    <div slot="content">
                        <Row>
                            <Table   border   :columns="addressColums" :data="mainAddressList">
                                <template slot-scope="{ row, index }" slot="action">
                                    <Button  @click="removeAddress(row)" type="primary" v-show="isCheck">删除</Button>
                                </template>
                                <template slot-scope="{ row, index }" slot="addressType">
                                    <span>{{setDictTitleByType("addressType",row.addressType)}}</span>
                                </template>
                                <template slot-scope="{ row, index }" slot="houseType">
                                    <span>{{setDictTitleByType("houseType",row.houseType)}}</span>
                                </template>
                                <template slot-scope="{ row, index }" slot="detailAddress">
                                    <Poptip placement="right" v-if="row.backSign==='yes'&&row.detailAddress!==row.detailAddressOld" >
                                        <span type="text" v-model="row.detailAddress">
                                        {{row.detailAddress}}</span><Icon type="md-warning" color="red"/>
                                        <div slot="title" style="font-weight: 700">{{row.detailAddressOld}}</div>
                                    </Poptip>
                                    <span v-if="row.backSign!=='yes'||row.detailAddress===row.detailAddressOld" >{{row.detailAddress}}</span>
                                </template>
                            </Table>
                        </Row>
                        <Row>
                            <Button @click="addAddress('main')" style="margin-top: 5px;float: right" icon="md-add" type="success" v-if="isCheck">新增地址</Button>
                        </Row>
                    </div>
                </Panel>
                <Panel name="4">
                    联系人信息
                    <div slot="content">
                            <Row>
                            <Table     border   :columns="contactColums" :data="contactList">
                                <template slot-scope="{ row, index }" slot="action">
                                    <Button style="margin-left:5px;" type="success" size="small"  @click="callPhone(row.telPhone,row.custRelation,row.custId,row.custName)" icon="md-call" v-show="isCheck">
                                    </Button>
                                    <Button v-if="isCheck&&row.custRelation==='00006'" style="margin-right:5px" type="success" size="small" @click="getMsgTemp(row.custName,row.telPhone,'02')" icon="md-mail">
                                    </Button>
                                    <Button v-if="isCheck&&row.custRelation!=='00006'" style="margin-right:5px" type="success" size="small" @click="getMsgTemp(row.custName,row.telPhone,'05')" icon="md-mail">
                                    </Button>
                                    <Button  @click="removeContact(row)" type="primary" v-show="isCheck">删除</Button>
                                </template>
                                <template slot-scope="{ row, index }" slot="custRelation">
                                    <span>{{setDictTitleByType("custRelation",row.custRelation)}}</span>
                                </template>
                                <template slot-scope="{ row, index }" slot="certType">
                                    <span>{{setDictTitleByType("certType",row.certType)}}</span>
                                </template>
                                <template slot-scope="{ row, index }" slot="custName">
                                    <Poptip placement="right" v-if="row.backSign==='yes'&&row.custName!==row.custNameOld&&row.custNameOld!=null" >
                                        <span type="text" v-model="row.telPhone">
                                        {{row.custName}}</span><Icon type="md-warning" color="red"/>
                                        <div slot="title" style="font-weight: 700">{{row.custNameOld}}</div>
                                    </Poptip>
                                    <span v-if="row.backSign!=='yes'||row.custName===row.custNameOld||(row.backSign==='yes'&&row.custNameOld==null)" >
                                    {{row.custName}}</span>
                                </template>
                                <template slot-scope="{ row, index }" slot="telPhone">
                                    <Poptip placement="right" v-if="row.backSign==='yes'&&row.telPhone!==row.telPhoneOld&&row.telPhoneOld!=null" >
                                        <span type="text" v-model="row.telPhone">
                                        {{row.telPhone}}</span><Icon type="md-warning" color="red"/>
                                        <div slot="title" style="font-weight: 700">{{row.telPhoneOld}}</div>
                                    </Poptip>
                                    <span v-if="row.backSign!=='yes'||row.telPhone===row.telPhoneOld||(row.telPhone==='yes'&&row.telPhone==null)" >
                                    {{row.telPhone}}</span>
                                </template>
                            </Table>
                        </Row>
                        <Row>
                            <Button @click="addContact" style="margin-top: 5px;float: right" icon="md-add" type="success" v-if="isCheck">新增联系人</Button>
                        </Row>
                    </div>
                </Panel>
                <Panel name="5" v-show="custShow.common">
                    共借人信息
                    <div slot="content">
                        <Row>
                            <Button @click="saveCommomCustInfo" style="float: right" type="success" v-if="isCheck">保存</Button>
                        </Row>
                        <Form ref="commomCustInfo" :model="commomCustInfo" label-position="right" :rules="commonCustInfoValidate" :label-width="160" inline>
                            <Row>
                                <Col span="24">
                                    <FormItem prop="custRelation" label="与申请人关系" disabled>
                                        <Select style="width: 150px" v-model="commomCustInfo.custRelation" disabled placeholder="请选择">
                                            <Option v-for="item in dataDic.custRelation" :label="item.title" :value="item.value" :key="item.value">{{ item.title }}</Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                            </Row>
                            <Row>
                                <Col span="8">
                                    <FormItem prop="custName" label="客户姓名">
                                        <Input type="text" v-model="commomCustInfo.custName" disabled placeholder="请输入">
                                        </Input>
                                    </FormItem>
                                </Col>
                                <Col span="16">
                                    <FormItem prop="spellName" label="拼音/英文">
                                        <Input type="text" v-model="commomCustInfo.spellName" disabled placeholder="请输入">
                                        </Input>
                                    </FormItem>
                                </Col>
                            </Row>
                            <Row>
                                <Col span="8">
                                    <FormItem prop="certType" label="证件类型">
                                        <Select style="width: 150px" v-model="commomCustInfo.certType" disabled placeholder="请选择">
                                            <Option v-for="item in dataDic.certType" :label="item.title" :value="item.value" :key="item.value">{{ item.title }}</Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                                <Col span="16">
                                    <FormItem prop="certNo" label="证件号码">
                                        <Input type="text" v-model="commomCustInfo.certNo" disabled placeholder="请输入">
                                        </Input>
                                    </FormItem>
                                </Col>
                            </Row>
                            <Row>
                                <Col span="8">
                                    <FormItem prop="birthday" label="出生日期">
                                        <DatePicker type="date" v-model="commomCustInfo.birthday" disabled placeholder="选择日期"></DatePicker>
                                    </FormItem>
                                </Col>
                                <Col span="8">
                                    <FormItem prop="certEndDate" label="证件到期日">
                                        <DatePicker type="date" v-model="commomCustInfo.certEndDate" disabled placeholder="选择日期"></DatePicker>
                                    </FormItem>
                                </Col>
                                <Col span="8">
                                    <FormItem prop="isLongTerm" label="是否长期有效">
                                        <Select style="width: 150px" v-model="commomCustInfo.isLongTerm" disabled placeholder="请选择">
                                            <Option v-for="item in dataDic.isType" :label="item.title" :value="item.value" :key="item.value">{{ item.title }}</Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                            </Row>
                            <Row>
                                <Col span="8">
                                    <FormItem prop="age" label="年龄">
                                        <Input type="text" v-model="commomCustInfo.age" disabled placeholder="请输入">
                                        </Input>
                                    </FormItem>
                                </Col>
                                <Col span="8">
                                    <FormItem prop="zodiac" label="生肖">
                                        <RadioGroup v-model="commomCustInfo.zod">
                                            <Radio v-for="item in commomCustInfo.zodiacList" :label="item" disabled></Radio>
                                        </RadioGroup>
                                    </FormItem>
                                </Col>
                                <Col span="8">

                                    <FormItem prop="maritalStatus" label="婚姻状况">
                                        <Select  style="width: 150px" v-model="commomCustInfo.maritalStatus" :disabled="!isCheck" placeholder="请选择">
                                            <Option  v-for="item in dataDic.maritalStatus" :label="item.title" :value="item.value" :key="item.value">{{ item.title }}</Option>
                                        </Select>
                                        <span :class="commomCustInfo.maritalStatus+'' !== commomCustInfo.maritalStatusOld+'' ? 'red' : ''" v-show="commomCustInfo.maritalStatus+'' !== commomCustInfo.maritalStatusOld+''&&commomCustInfo.maritalStatusOld!=null">
                                                {{setMaritalStatusTitle(commomCustInfo.maritalStatusOld)}}
                                        </span>
                                    </FormItem>
                                </Col>
                            </Row>
                            <Row>
                                <Col span="8">
                                    <FormItem prop="census" label="户籍所在地">
                                        <i-select style="width: 150px" v-model="commomCustInfo.province" placement="top" placeholder="请选择" @on-change="queryCommonCity" :disabled="!isCheck">
                                            <i-option v-for="(item,index) in provinces" style="width: 150px" :label="item.label" :value="item.value" :key="index">{{ item.label }}</i-option>
                                        </i-select>
                                        <Select style="width: 150px" v-model="commomCustInfo.city" placement="top" placeholder="请选择" :disabled="!isCheck">
                                            <Option v-for="(item,index) in commonCities" style="width: 150px" :label="item.label" :value="item.value" :key="index">{{ item.label }}</Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                                <Col span="8">
                                    <FormItem prop="nationality" label="国籍">
                                        <Select style="width: 150px" v-model="mainBaseInfo.nationality" disabled placeholder="请选择">
                                            <Option v-for="item in dataDic.nationality" :label="item.title" :value="item.value" :key="item.value">{{ item.title }}</Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                                <Col span="8">
                                    <FormItem prop="workAge" label="工作年限">
                                        <Input type="text" v-model="commomCustInfo.workAge" :disabled="!isCheck" placeholder="请输入">
                                        </Input>
                                    </FormItem>
                                </Col>
                            </Row>
                            <Row>
                                <Col span="8">
                                    <FormItem prop="sex" label="性别">
                                        <Select style="width: 150px" v-model="commomCustInfo.sex" disabled placeholder="请选择">
                                            <Option v-for="item in dataDic.sex" :label="item.title" :value="item.value" :key="item.value">{{ item.title }}</Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                                <Col span="16">
                                    <FormItem prop="telPhone" label="手机号码">
                                        <div style="display: flex; flex-flow: row;">
                                        <Input v-if="this.backSign!=='yes'||commomCustInfo.telPhone===commomCustInfo.telPhoneOld||(this.backSign==='yes'&&commomCustInfo.telPhoneOld==null)" type="text" v-model="commomCustInfo.telPhone" disabled placeholder="请输入">
                                        </Input>
                                        <Poptip placement="bottom" v-if="this.backSign==='yes'&&commomCustInfo.telPhone!==commomCustInfo.telPhoneOld&&commomCustInfo.telPhoneOld!=null" >
                                            <Input type="text" v-model="commomCustInfo.telPhone" disabled placeholder="请输入" icon="ios-warning">
                                            </Input>
                                            <div slot="title" style="font-weight: 700">{{commomCustInfo.telPhoneOld}}</div>
                                        </Poptip>
                                        <Button style="margin-left:5px;" type="success" size="small"  @click="callPhone(commomCustInfo.telPhone,commomCustInfo.custRelation,commomCustInfo.id,mainBaseInfo.custName)"  icon="md-call" >
                                        </Button>
                                        <Button style="margin-left:5px" type="success" size="small" @click="getMsgTemp(commomCustInfo.custName,commomCustInfo.telPhone,'03')" icon="md-mail">
                                        </Button>
                                        </div>
                                    </FormItem>
                                </Col>
                            </Row>
                            <Row>
                                <Col span="8">
                                    <FormItem prop="highestEducation" label="学历">
                                        <Select style="width: 150px" v-model="commomCustInfo.highestEducation" :disabled="!isCheck" placeholder="请选择">
                                            <Option v-for="item in dataDic.highestEducation" :label="item.title" :value="item.value" :key="item.value">{{ item.title }}</Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                                <Col span="16">
                                    <FormItem prop="newPhone" label="新增号码">
                                        <Input type="text" v-model="commomCustInfo.newPhone" :disabled="!isCheck" placeholder="请输入">
                                        </Input>
                                    </FormItem>
                                </Col>
                            </Row>
                        </Form>
                    </div>
                </Panel>

                 <Panel name="6" v-show="custShow.common">
                                共借人工作信息
                     <div slot="content">
                         <Row>
                             <Button @click="saveCommonWorkInfo" style="float: right" type="success" v-if="isCheck">保存</Button>
                         </Row>
                        <Form ref="commomCustInfo" border :model="commomCustInfo" label-position="right" :rules="commonWorkInfoValidate" :label-width="160" inline>
                               <row>
                                <Col span="8">
                                    <FormItem prop="unitName" label="单位名称">
                                        <Poptip placement="bottom" v-if="this.backSign==='yes'&&commomCustInfo.unitName!==commomCustInfo.unitNameOld&&commomCustInfo.unitNameOld!=null" >
                                            <Input type="text" v-model="commomCustInfo.unitName" :disabled="!isCheck" placeholder="请输入" icon="ios-warning">
                                            </Input>
                                            <div slot="title" style="font-weight: 700">{{commomCustInfo.unitNameOld}}</div>
                                        </Poptip>
                                        <Input v-if="this.backSign!=='yes'||commomCustInfo.unitName===commomCustInfo.unitNameOld||(this.backSign==='yes'&&commomCustInfo.unitNameOld==null)" type="text" v-model="commomCustInfo.unitName" :disabled="!isCheck" placeholder="请输入">
                                        </Input>
                                    </FormItem>
                                </Col>
                                <Col span="8">
                                    <FormItem prop="unitType" label="单位性质">
                                        <Select style="width: 150px" v-model="commomCustInfo.unitType" disabled placeholder="请选择">
                                            <Option v-for="item in dataDic.unitNature" :label="item.title" :value="item.value" :key="item.value">{{ item.title }}</Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                                <Col span="8">
                                    <FormItem prop="industryType" label="行业类型">
                                        <Select style="width: 150px" v-model="commomCustInfo.industryType" :disabled="!isCheck" placeholder="请选择">
                                            <Option v-for="item in dataDic.industryType" :label="item.title" :value="item.value" :key="item.value">{{ item.title }}</Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                            </Row>
                            <Row>
                                <Col span="8">
                                    <FormItem prop="professionalType" label="职业类型">
                                        <Select style="width: 150px" v-model="commomCustInfo.professionalType" :disabled="!isCheck" placeholder="请选择">
                                            <Option v-for="item in dataDic.jobsType" :label="item.title" :value="item.value" :key="item.value">{{ item.title }}</Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                                <Col span="8">
                                    <FormItem prop="position" label="职务">
                                        <Select style="width: 150px" v-model="commomCustInfo.position" :disabled="!isCheck" placeholder="请选择">
                                            <Option v-for="item in dataDic.position" :label="item.title" :value="item.value" :key="item.value">{{ item.title }}</Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                                <Col span="8">
                                    <FormItem prop="unitTelPhone" label="公司电话">
                                        <Input type="text" v-model="commomCustInfo.unitTelPhone" :disabled="!isCheck" placeholder="请输入">
                                        </Input>
                                        <Button style="margin-left:5px;" type="success" size="small"  @click="isCallOut=true" icon="md-call" v-show="isCheck">
                                        </Button>
                                    </FormItem>
                                </Col>
                            </Row>
                            <Row>
                                <Col span="8">
                                    <FormItem prop="monthlyIncome" label="本人月收入">
                                        <Input type="text" v-model="commomCustInfo.monthlyIncome" :disabled="!isCheck" placeholder="请输入">
                                        </Input>
                                    </FormItem>
                                </Col>
                                <Col span="8">
                                    <FormItem prop="familyIncome" label="家庭总收入">
                                        <Input type="text" v-model="commomCustInfo.familyIncome" :disabled="!isCheck" placeholder="请输入">
                                        </Input>
                                    </FormItem>
                                </Col>
                                <Col span="8">
                                    <FormItem prop="outstandingLoan" label="未结清贷款">
                                        <Input type="text" v-model="commomCustInfo.outstandingLoan" :disabled="!isCheck" placeholder="请输入">
                                        </Input>
                                    </FormItem>
                                </Col>
                            </Row>
                        </Form>
                    </div>
                </Panel>
                <Panel name="7" v-show="custShow.common">
                    共借人地址信息
                    <div slot="content">
                        <Row>
                            <Table  c border :columns="addressColums" :data="commonAddressList">
                                <template slot-scope="{ row, index }" slot="action">
                                    <Button  @click="removeCommonAddress(row)" type="primary" v-show="isCheck">删除</Button>
                                </template>
                                <template slot-scope="{ row, index }" slot="addressType">
                                    <span>{{setDictTitleByType("addressType",row.addressType)}}</span>
                                </template>
                                <template slot-scope="{ row, index }" slot="houseType">
                                    <span>{{setDictTitleByType("houseType",row.houseType)}}</span>
                                </template>
                                <template slot-scope="{ row, index }" slot="detailAddress">
                                    <Poptip placement="right" v-if="row.backSign==='yes'&&row.detailAddress!==row.detailAddressOld&&row.detailAddressOld!=null" >
                                        <span type="text" v-model="row.detailAddress">
                                        {{row.detailAddress}}</span><Icon type="md-warning" color="red"/>
                                        <div slot="title" style="font-weight: 700">{{row.detailAddressOld}}</div>
                                    </Poptip>
                                    <span v-if="row.backSign!=='yes'||row.detailAddress===row.detailAddressOld||(row.backSign==='yes'&&row.detailAddressOld==null)" >{{row.detailAddress}}</span>
                                </template>
                            </Table>
                        </Row>
                        <Row>
                            <Button @click="addAddress('common')" style="margin-top: 5px;float: right" icon="md-add" type="success">新增地址</Button>
                        </Row>
                    </div>
                </Panel>
                <Panel name="8" v-show="custShow.guaran">
                    保证人信息
                    <div slot="content">
                        <Row>
                            <Button @click="saveGuarantorInfo" style="float: right" type="success" v-if="isCheck">保存</Button>
                        </Row>
                        <Form ref="guarantorInfo" :model="guarantorInfo" label-position="right" :rules="guarantorInfoValidate" :label-width="160" inline>
                            <Row>
                                <Col span="24">
                                    <FormItem prop="custRelation" label="与申请人关系" disabled>
                                        <Select style="width: 150px" v-model="guarantorInfo.custRelation" disabled placeholder="请选择">
                                            <Option v-for="item in dataDic.custRelation" :label="item.title" :value="item.value" :key="item.value">{{ item.title }}</Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                            </Row>
                            <Row>
                                <Col span="8">
                                    <FormItem prop="custName" label="客户姓名">
                                        <Input type="text" v-model="guarantorInfo.custName" disabled placeholder="请输入">
                                        </Input>
                                    </FormItem>
                                </Col>
                                <Col span="16">
                                    <FormItem prop="spellName" label="拼音/英文">
                                        <Input type="text" v-model="guarantorInfo.spellName" disabled placeholder="请输入">
                                        </Input>
                                    </FormItem>
                                </Col>
                            </Row>
                            <Row>
                                <Col span="8">
                                    <FormItem prop="certType" label="证件类型">
                                        <Select style="width: 150px" v-model="guarantorInfo.certType" disabled placeholder="请选择">
                                            <Option v-for="item in dataDic.certType" :label="item.title" :value="item.value" :key="item.value">{{ item.title }}</Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                                <Col span="16">
                                    <FormItem prop="certNo" label="证件号码">
                                        <Input type="text" v-model="guarantorInfo.certNo" disabled placeholder="请输入">
                                        </Input>
                                    </FormItem>
                                </Col>
                            </Row>
                            <Row>
                                <Col span="8">
                                    <FormItem prop="birthday" label="出生日期">
                                        <DatePicker type="date" v-model="guarantorInfo.birthday" disabled placeholder="选择日期"></DatePicker>
                                    </FormItem>
                                </Col>
                                <Col span="8">
                                    <FormItem prop="certEndDate" label="证件到期日">
                                        <DatePicker type="date" v-model="guarantorInfo.certEndDate" disabled placeholder="选择日期"></DatePicker>
                                    </FormItem>
                                </Col>
                                <Col span="8">
                                    <FormItem prop="isLongTerm" label="是否长期有效">
                                        <Select style="width: 150px" v-model="guarantorInfo.isLongTerm" disabled placeholder="请选择">
                                            <Option v-for="item in dataDic.isType" :label="item.title" :value="item.value" :key="item.value">{{ item.title }}</Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                            </Row>
                            <Row>
                                <Col span="8">
                                    <FormItem prop="age" label="年龄">
                                        <Input type="text" v-model="guarantorInfo.age" disabled placeholder="请输入">
                                        </Input>
                                    </FormItem>
                                </Col>
                                <Col span="8">
                                    <FormItem prop="zodiac" label="生肖">
                                        <RadioGroup v-model="guarantorInfo.zod">
                                            <Radio v-for="item in guarantorInfo.zodiacList" :label="item" disabled></Radio>
                                        </RadioGroup>
                                    </FormItem>
                                </Col>
                                <Col span="8">
                                    <FormItem prop="maritalStatus" label="婚姻状况">
                                        <Select  style="width: 150px" v-model="guarantorInfo.maritalStatus" :disabled="!isCheck" placeholder="请选择">
                                            <Option  v-for="item in dataDic.maritalStatus" :label="item.title" :value="item.value" :key="item.value">{{ item.title }}</Option>
                                        </Select>
                                        <span :class="guarantorInfo.maritalStatus+'' !== guarantorInfo.maritalStatusOld+'' ? 'red' : ''" v-show="guarantorInfo.maritalStatus+'' !== guarantorInfo.maritalStatusOld+''&&guarantorInfo.maritalStatusOld!=null">
                                                {{setMaritalStatusTitle(guarantorInfo.maritalStatusOld)}}
                                        </span>
                                    </FormItem>
                                </Col>
                            </Row>
                            <Row>
                                <Col span="8">
                                    <FormItem prop="census" label="户籍所在地">
                                        <i-select style="width: 150px" v-model="guarantorInfo.province" placement="top" placeholder="请选择" @on-change="queryGuarantorCity" :disabled="!isCheck">
                                            <i-option v-for="(item,index) in provinces" style="width: 150px" :label="item.label" :value="item.value" :key="index">{{ item.label }}</i-option>
                                        </i-select>
                                        <Select style="width: 150px" v-model="guarantorInfo.city" placement="top" placeholder="请选择" :disabled="!isCheck">
                                            <Option v-for="(item,index) in guarantorCities" style="width: 150px" :label="item.label" :value="item.value" :key="index">{{ item.label }}</Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                                <Col span="8">
                                    <FormItem prop="nationality" label="国籍">
                                        <Select style="width: 150px" v-model="mainBaseInfo.nationality" disabled placeholder="请选择">
                                            <Option v-for="item in dataDic.nationality" :label="item.title" :value="item.value" :key="item.value">{{ item.title }}</Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                                <Col span="8">
                                    <FormItem prop="workAge" label="工作年限">
                                        <Input type="text" v-model="guarantorInfo.workAge" :disabled="!isCheck" placeholder="请输入">
                                        </Input>
                                    </FormItem>
                                </Col>
                            </Row>
                            <Row>
                                <Col span="8">
                                    <FormItem prop="sex" label="性别">
                                        <Select style="width: 150px" v-model="guarantorInfo.sex" disabled placeholder="请选择">
                                            <Option v-for="item in dataDic.sex" :label="item.title" :value="item.value" :key="item.value">{{ item.title }}</Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                                <Col span="16">
                                    <FormItem prop="telPhone" label="手机号码">
                                        <div style="display: flex; flex-flow: row;">
                                        <Poptip placement="bottom" v-if="this.backSign==='yes'&&guarantorInfo.telPhone!==guarantorInfo.telPhoneOld&&guarantorInfo.telPhoneOld!=null" >
                                            <Input type="text" v-model="guarantorInfo.telPhone" disabled placeholder="请输入" icon="ios-warning">
                                            </Input>
                                            <div slot="title" style="font-weight: 700">{{guarantorInfo.telPhoneOld}}</div>
                                        </Poptip>
                                        <Input v-if="this.backSign!=='yes'||guarantorInfo.telPhone===guarantorInfo.telPhoneOld||(this.backSign==='yes'&&guarantorInfo.telPhoneOld==null)" type="text" v-model="guarantorInfo.telPhone" disabled placeholder="请输入">
                                        </Input>
                                        <Button style="margin-left:5px;" type="success" size="small" @click="callPhone(guarantorInfo.telPhone,guarantorInfo.custRelation,guarantorInfo.id,guarantorInfo.custName)" icon="md-call" >
                                        </Button>
                                        <Button style="margin-left:5px" type="success" size="small" @click="getMsgTemp(guarantorInfo.custName,guarantorInfo.telPhone,'04')" icon="md-mail" >
                                        </Button>
                                        </div>
                                    </FormItem>
                                </Col>
                            </Row>
                            <Row>
                                <Col span="8">
                                    <FormItem prop="highestEducation" label="学历">
                                        <Select style="width: 150px" v-model="guarantorInfo.highestEducation" :disabled="!isCheck" placeholder="请选择">
                                            <Option v-for="item in dataDic.highestEducation" :label="item.title" :value="item.value" :key="item.value">{{ item.title }}</Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                                <Col span="16">
                                    <FormItem prop="newPhone" label="新增号码">
                                        <Input type="text" v-model="guarantorInfo.newPhone" :disabled="!isCheck" placeholder="请输入">
                                        </Input>
                                    </FormItem>
                                </Col>
                            </Row>
                        </Form>
                    </div>
                </Panel>
                <Panel name="9" v-show="custShow.guaran">
                    保证人工作信息
                    <div slot="content">
                        <Row>
                            <Button @click="saveGuarantorWorkInfo" style="float: right" type="success" v-if="isCheck">保存</Button>
                        </Row>
                        <Form ref="guarantorInfo" :model="guarantorInfo" label-position="right" :rules="guarantorWorkInfoValidate" :label-width="160" inline>
                            <Row>
                                <Col span="8">
                                    <FormItem prop="unitName" label="公司名称">
                                    <Poptip placement="bottom" v-if="this.backSign==='yes'&&guarantorInfo.unitName!==guarantorInfo.unitNameOld&&guarantorInfo.unitNameOld!=null" >
                                        <Input type="text" v-model="guarantorInfo.unitName" :disabled="!isCheck" placeholder="请输入" icon="ios-warning">
                                        </Input>
                                        <div slot="title" style="font-weight: 700">{{guarantorInfo.unitNameOld}}</div>
                                    </Poptip>
                                    <Input v-if="this.backSign!=='yes'||guarantorInfo.unitName===guarantorInfo.unitNameOld||(this.backSign==='yes'&&guarantorInfo.unitNameOld==null)" type="text" v-model="guarantorInfo.unitName" :disabled="!isCheck" placeholder="请输入">
                                    </Input>
                                    </FormItem>
                                </Col>
                                <Col span="8">
                                    <FormItem prop="unitType" label="单位性质">
                                        <Select style="width: 150px" v-model="guarantorInfo.unitType" disabled placeholder="请选择">
                                            <Option v-for="item in dataDic.unitNature" :label="item.title" :value="item.value" :key="item.value">{{ item.title }}</Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                                <Col span="8">
                                    <FormItem prop="industryType" label="行业类型">
                                        <Select style="width: 150px" v-model="guarantorInfo.industryType" :disabled="!isCheck" placeholder="请选择">
                                            <Option v-for="item in dataDic.industryType" :label="item.title" :value="item.value" :key="item.value">{{ item.title }}</Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                            </Row>
                            <Row>
                                <Col span="8">
                                    <FormItem prop="professionalType" label="职业类型">
                                        <Select style="width: 150px" v-model="guarantorInfo.professionalType" :disabled="!isCheck" placeholder="请选择">
                                            <Option v-for="item in dataDic.jobsType" :label="item.title" :value="item.value" :key="item.value">{{ item.title }}</Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                                <Col span="8">
                                    <FormItem prop="position" label="职务">
                                        <Select style="width: 150px" v-model="guarantorInfo.position" :disabled="!isCheck" placeholder="请选择">
                                            <Option v-for="item in dataDic.position" :label="item.title" :value="item.value" :key="item.value">{{ item.title }}</Option>
                                        </Select>
                                    </FormItem>
                                </Col>
                                <Col span="8">
                                    <FormItem prop="unitTelPhone" label="公司电话">
                                        <Input type="text" v-model="guarantorInfo.unitTelPhone" :disabled="!isCheck" placeholder="请输入">
                                        </Input>
                                        <Button style="margin-left:5px;" type="success" size="small"  @click="isCallOut=true" icon="md-call" v-show="isCheck">
                                        </Button>
                                    </FormItem>
                                </Col>
                            </Row>
                            <Row>
                                <Col span="8">
                                    <FormItem prop="monthlyIncome" label="本人月收入">
                                        <Input type="text" v-model="guarantorInfo.monthlyIncome" :disabled="!isCheck" placeholder="请输入">
                                        </Input>
                                    </FormItem>
                                </Col>
                                <Col span="8">
                                    <FormItem prop="familyIncome" label="家庭总收入">
                                        <Input type="text" v-model="guarantorInfo.familyIncome" :disabled="!isCheck" placeholder="请输入">
                                        </Input>
                                    </FormItem>
                                </Col>
                                <Col span="8">
                                    <FormItem prop="outstandingLoan" label="未结清贷款">
                                        <Input type="text" v-model="guarantorInfo.outstandingLoan" :disabled="!isCheck" placeholder="请输入">
                                        </Input>
                                    </FormItem>
                                </Col>
                            </Row>
                        </Form>
                    </div>
                </Panel>
                <Panel name="10" v-show="custShow.guaran">
                    保证人地址信息
                    <div slot="content">
                        <Row>
                            <Table   border :columns="addressColums" :data="guaranAddressList">
                                <template slot-scope="{ row, index }" slot="action">
                                    <Button  @click="removeGuaranAddress(row)" type="primary" v-show="isCheck">删除</Button>
                                </template>
                                <template slot-scope="{ row, index }" slot="addressType">
                                    <span>{{setDictTitleByType("addressType",row.addressType)}}</span>
                                </template>
                                <template slot-scope="{ row, index }" slot="houseType">
                                    <span>{{setDictTitleByType("houseType",row.houseType)}}</span>
                                </template>
                                <template slot-scope="{ row, index }" slot="detailAddress">
                                    <Poptip placement="right" v-if="row.backSign==='yes'&&row.detailAddress!==row.detailAddressOld&&row.detailAddressOld!=null" >
                                        <span type="text" v-model="row.detailAddress">
                                        {{row.detailAddress}}</span><Icon type="md-warning" color="red"/>
                                        <div slot="title" style="font-weight: 700">{{row.detailAddressOld}}</div>
                                    </Poptip>
                                    <span v-if="row.backSign!=='yes'||row.detailAddress===row.detailAddressOld||(row.backSign==='yes'&&row.detailAddressOld==null)" >{{row.detailAddress}}</span>
                                </template>
                            </Table>
                        </Row>
                        <Row>
                            <Button @click="addAddress('guaran')" style="margin-top: 5px;float: right" icon="md-add" type="success">新增地址</Button>
                        </Row>
                    </div>
                </Panel>
            </Collapse>
        </Card>
        <Modal :title="addressTitle" v-model="addressVisible" :mask-closable='false' :width="450" :styles="{top: '90px'}">
            <Form ref="addressFrom" :model="addressFrom" :label-width="150" :rules="addressFromValidate">
                <FormItem label="省份" prop="province">
                    <i-select style="width: 150px" v-model="addressFrom.province" placement="top" placeholder="请选择" @on-change="queryCity">
                        <i-option v-for="(item,index) in provinces" style="width: 150px" :label="item.label" :value="item.value" :key="index">{{ item.label }}</i-option>
                    </i-select>
                </FormItem>
                <FormItem label="城市" prop="city">
                    <Select style="width: 150px" v-model="addressFrom.city" placement="top" placeholder="请选择">
                        <Option v-for="(item,index) in cities" style="width: 150px" :label="item.label" :value="item.value" :key="index">{{ item.label }}</Option>
                    </Select>
                    <!--<Input v-model="addressFrom.city" autocomplete="off"/>-->
                </FormItem>
                <FormItem label="详细地址" prop="detailAddress">
                    <Input v-model="addressFrom.detailAddress" autocomplete="off"/>
                </FormItem>
                <FormItem label="地址类型" prop="addressType">
                    <Select style="width: 150px" v-model="addressFrom.addressType" placeholder="请选择" @on-change="changeAddress">
                        <Option v-for="item in dataDic.addressType" style="width: 150px" :label="item.title" :value="item.value" :key="item.value">{{ item.title }}</Option>
                    </Select>
                </FormItem>
                <FormItem label="房产类型" prop="houseType">
                    <Select style="width: 150px" v-model="addressFrom.houseType" placeholder="请选择">
                        <Option v-for="item in dataDic.houseType" :label="item.title" :value="item.value" :key="item.value">{{ item.title }}</Option>
                    </Select>
                </FormItem>
                <FormItem label="起始时间" prop="houseStartDate">
                    <DatePicker v-model="addressFrom.houseStartDate" type="date" placeholder="请选择起始时间" :options="options"></DatePicker>
                </FormItem>
            </Form>
            <div slot="footer">
                <Button type="text" @click="cancelAddress">取消</Button>
                <Button type="primary" :loading="submitLoading" @click="submitAddress">提交</Button>
            </div>
        </Modal>
        <Modal :title="contactTitle" v-model="contactVisible" :mask-closable='false' :width="450" :styles="{top: '50px'}" :closable="false">
            <Form ref="contactFrom" :model="contactFrom" :label-width="150" :rules="contactFromValidate">
                <FormItem label="姓名" prop="custName">
                    <Input v-model="contactFrom.custName" autocomplete="off"/>
                </FormItem>
                <FormItem label="与申请人关系" prop="custRelation" style="width: 300px;">
                    <Select style="width: 150px" v-model="contactFrom.custRelation" placeholder="请选择">
                        <Option v-for="item in dataDic.custRelation" :label="item.title" :value="item.value" :key="item.value">{{ item.title }}</Option>
                    </Select>
                </FormItem>
                <FormItem label="证件类型" prop="certType">
                    <Select style="width: 150px" v-model="contactFrom.certType" placeholder="请选择">
                        <Option v-for="item in dataDic.certType" :label="item.title" :value="item.value" :key="item.value">{{ item.title }}</Option>
                    </Select>
                </FormItem>
                <FormItem label="证件号码" prop="certNo">
                    <Input v-model="contactFrom.certNo" autocomplete="off"/>
                </FormItem>
                <FormItem label="手机号码" prop="telPhone">
                    <Input type="tel" v-model="contactFrom.telPhone" autocomplete="off"/>
                </FormItem>
                <FormItem label="公司名称" prop="companyName">
                    <Input v-model="contactFrom.companyName" autocomplete="off"/>
                </FormItem>
                <FormItem label="公司电话" prop="companyPhone">
                    <Input v-model="contactFrom.companyPhone" autocomplete="off"/>
                </FormItem>
                <FormItem label="月收入" prop="monthlyIncome">
                    <Input type="number" v-model="contactFrom.monthlyIncome" autocomplete="off"/>
                </FormItem>
                <FormItem label="现居住地" prop="detailAddress">
                    <Input v-model="contactFrom.detailAddress" autocomplete="off"/>
                </FormItem>
            </Form>
            <div slot="footer">
                <Button type="text" @click="cancelContact">取消</Button>
                <Button type="primary" :loading="submitLoading" @click="submitContact">提交</Button>
            </div>
        </Modal>
        <Modal v-model="msgModelVisible" title="短信模板" :mask-closable='false' :width="350" :closable="false">
            <Spin fix size="large" v-if="msgModelLoading">
                <slot name="loading"></slot>
            </Spin>
            <Form v-model="msgTemplate">
                <Form-item label="模板内容:" prop="templateContent">
                    <textarea v-model="msgTemplate.templateContent" type="textarea" :rows="4" style="width: 320px;height: 200px;line-height: 20px"
                              placeholder="请输入短信模板" maxlength="512"/>
                </Form-item>
            </Form>
            <div slot="footer">
                <Button type="primary" @click="sendMsg">发送</Button>
                <Button type="primary" ghost @click="closeMsg" >关闭</Button>
            </div>
        </Modal>
    </div>
</template>

<script>
    //软电话
    import { mapMutations } from "vuex";
    //短信发送
    import {
        sendMessageInfo,
        getMsgTempByType,
        sendMsg
    } from "@/projects/afs-core-business/api/afs-case/message-template/messageTemplate";
    import circleLoading from "_c/circle-loading/circle-loading.vue";
    import Softphone from "_p/basic/pages/softphone/softphone";

    import {
        getByTypes,
        getDictDataByType
    } from "_p/basic/api/admin/datadic";
    import {
        queryMainBaseInfo,
        queryMainWorkInfo,
        queryCommomCustInfo,
        queryContactList,
        queryAddressList,
        queryPageArea,
        saveAddress,
        saveContact,
        removeContactById,
        getAddressList,
        removeAddressById,
        saveMainInfo,
        saveWorkInfo,
        saveCommomCustInfo,
        saveCommonWorkInfo,
        saveGuarantorInfo,
        saveGuarantorWorkInfo
    } from "../../../../api/afs-case/infomationDetail/applyCustomerDetail";
    //冗余联系人
    import custContact from "../cust/custContact";
    export default {
        props: {
            applyNo: {
                required: false,
                default:()=>{
                    return '';
                }
            },
            isCheck: {
                type: Boolean
            },
            isAppear: {
                type: Boolean
            },
            tabName:{
                type:String
            }
        },
        name: "apply-customer-detail",
        components: {
            circleLoading,
            custContact
        },
        data: function () {
            return {
                backSign:'',
                zodiacList:['狗', '猪','鼠', '牛', '虎', '兔', '龙', '蛇', '马', '羊','猴', '鸡', '狗', '猪','鼠', '牛'],
                applyNumber:'',
                submitLoading: false,
                values:["1","2","3","4","5","6","7","8","9","10"],
                addressVisible:false,
                addressModalType: 0,
                provinceLevel: "1",
                provinces:{},
                cities: {},
                mainCities: {},
                commonCities: {},
                guarantorCities: {},
                custShow:{
                    common:false,
                    guaran:false
                },
                options: {
                    disabledDate (date) {
                        return date && date.valueOf() >= new Date();
                    }
                },
                dicKeys: [
                    "certType","maritalStatus","isType","drivingType","highestEducation",
                    "unitNature","industryType","jobsType","position","custRelation","sex",
                    "addressType","houseType","nationality"
                ],
                dataDic: {},
                addressTitle:"",
                addressFrom:{
                    custId:"",
                    province: "",
                    city: "",
                    detailAddress: "",
                    addressType: "",
                    houseType: "",
                    houseStartDate: ""
                },
                addressFromValidate:{
                    province:[
                        {required: true, message: "请选择省份", trigger: "blur"}
                    ],
                    // 业务类型校验
                    city:[
                        {required: true, message: "请选择城市", trigger: "blur"}
                    ],
                    detailAddress:[
                        {required: true, message: "详细地址不能为空", trigger: "blur"}
                    ],
                    addressType:[
                        {required: true, message: "请选择地址类型", trigger: "change"}
                    ],
                    houseType:[
                        {required: true, message: "请选择房产类型", trigger: "change"}
                    ],
                    houseStartDate:[
                        {required: true, message: "请选择起始时间", trigger: "change",pattern: /.+/}
                    ],
                },
                contactFromValidate:{
                    custName:[
                        {required: true, message: "请输入姓名", trigger: "blur"}
                    ],
                    // 业务类型校验
                    custRelation:[
                        {required: true, message: "请选择与申请人关系", trigger: "change"}
                    ],
                    certType:[
                        {required: false, message: "请选择证件类型", trigger: "change"}
                    ],
                    certNo:[
                        {required: false, message: "请输入证件号码", trigger: "blur"},
                        {pattern: /^\d{6}(1[8-9]|[2-9][0-9])\d{2}(0[1-9]|1[12])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/, message: '请输入正确的身份证号码', trigger: 'blur'}
                    ],
                    telPhone:[
                        {required: true, message: "请输入手机号码", trigger: "blur"},
                        {pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号码', trigger: 'blur'}
                    ],
                    companyName:[
                        {required: false, message: "请输入公司名称", trigger: "blur"}
                    ],
                    companyPhone:[
                        {required: false, message: "请输入公司电话", trigger: "blur"}
                    ],
                    monthlyIncome:[
                        {required: false, message: "请输入月收入", trigger: "blur"}
                    ],
                    detailAddress:[
                        {required: false, message: "请输入详细地址", trigger: "blur"}
                    ],
                },
                mainBaseInfoValidate:{
                    newPhone:[
                        {required: false, message: "请输入手机号码", trigger: "blur"},
                        {pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号码', trigger: 'blur'}
                    ],
                    workAge:[
                        {required:true, message: "请输入工作年限",trigger: "blur"}
                    ],
                    drivingLicenceNo:[
                        {required:false, message: "请输入驾驶证档案编号",trigger: "blur"},
                        {pattern: /^[1-8]\d{11}$/, message: '请输入正确的驾驶证档案编号', trigger: 'blur'}
                    ]
                },
                commonCustInfoValidate:{
                    newPhone:[
                        {required: false, message: "请输入手机号码", trigger: "blur"},
                        {pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号码', trigger: 'blur'}
                    ],
                    workAge:[
                        {required:true, message: "请输入工作年限",trigger: "blur"}
                    ]
                },
                mainWorkInfoValidate: {
                    unitName:[
                        {required:true, message: "请输入单位名称",trigger: "blur"}
                    ],
                    unitTelPhone:[
                        {required:false, message: "请输入公司电话", trigger: "blur"},
                        {pattern: /^((0\d{2,3}(-?)\d{7,8})|(1[3456789]\d{9}))$/, message: '请输入正确的公司电话', trigger: 'blur'}
                    ],
                    monthlyIncome:[
                        {required:true, message: "请输入本人月收入",trigger: "blur"}
                    ]
                },
                commonWorkInfoValidate: {
                    unitName:[
                        {required:true, message: "请输入单位名称",trigger: "blur"}
                    ],
                    unitTelPhone:[
                        {required:false, message: "请输入公司电话", trigger: "blur"},
                        {pattern: /^((0\d{2,3}(-?)\d{7,8})|(1[3456789]\d{9}))$/, message: '请输入正确的公司电话', trigger: 'blur'}
                    ],
                    monthlyIncome:[
                        {required:true, message: "请输入本人月收入",trigger: "blur"}
                    ]
                },
                guarantorInfoValidate: {
                    newPhone:[
                        {required: false, message: "请输入手机号码", trigger: "blur"},
                        {pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号码', trigger: 'blur'}
                    ],
                    workAge:[
                        {required:true, message: "请输入工作年限",trigger: "blur"}
                    ]
                },
                guarantorWorkInfoValidate: {
                    unitName:[
                        {required:true, message: "请输入单位名称",trigger: "blur"}
                    ],
                    unitTelPhone:[
                        {required:false, message: "请输入公司电话", trigger: "blur"},
                        {pattern: /^((0\d{2,3}(-?)\d{7,8})|(1[3456789]\d{9}))$/, message: '请输入正确的公司电话', trigger: 'blur'}
                    ],
                    monthlyIncome:[
                        {required:true, message: "请输入本人月收入",trigger: "blur"}
                    ]
                },
                contactVisible:false,
                contactModalType: 0,
                contactTitle:"",
                level:"",
                upperCode:"",
                contactFrom:{
                    applyNo:"",
                    custId:"",
                    id:"",
                    custName: "",
                    custRelation: "",
                    certType: "",
                    certNo: "",
                    telPhone: "",
                    companyName: "",
                    companyPhone: "",
                    monthlyIncome: "",
                    detailAddress: ""
                },
                addressColums: [
                    {
                        title: "操作",
                        key: "action",
                        minWidth: 100,
                        align: "center",
                        slot: "action"
                    },
                    {
                        title: "省份",
                        key: "province",
                        minWidth: 100,
                        align: "center"

                    },
                    {
                        title: "城市",
                        key: "city",
                        minWidth: 100,
                        align: "center"
                    },
                    {
                        title: "详细地址",
                        key: "detailAddress",
                        minWidth: 150,
                        align: "center",
                        slot:"detailAddress"
                    },
                    {
                        title: "地址类型",
                        key: "addressType",
                        minWidth: 100,
                        align: "center",
                        slot:"addressType"
                    },
                    {
                        title: "房产类型",
                        key: "houseType",
                        minWidth: 100,
                        align: "center",
                        slot:"houseType"
                    },
                    {
                        title: "起始时间",
                        key: "houseStartDate",
                        minWidth: 100,
                        align: "center"
                    }
                ],
                contactColums: [
                    {
                        title: "操作",
                        key: "action",
                        minWidth: 150,
                        align: "center",
                        slot: "action"
                    },
                    {
                        title: "姓名",
                        key: "custName",
                        minWidth: 100,
                        align: "center",
                        slot: "custName"
                    },
                    {
                        title: "与申请人关系",
                        key: "custRelation",
                        minWidth: 100,
                        align: "center",
                        slot:"custRelation"
                    },
                    {
                        title: "证件类型",
                        key: "certType",
                        minWidth: 100,
                        align: "center",
                        slot:"certType"
                    },
                    {
                        title: "证件号码",
                        key: "certNo",
                        minWidth: 150,
                        align: "center"
                    },
                    {
                        title: "手机号码",
                        key: "telPhone",
                        minWidth: 100,
                        align: "center",
                        slot: "telPhone"
                    },
                    {
                        title: "公司名称",
                        key: "companyName",
                        minWidth: 100,
                        align: "center"
                    },
                    {
                        title: "月收入",
                        key: "monthlyIncome",
                        minWidth: 100,
                        align: "center"
                    },
                    {
                        title: "现居住地",
                        key: "detailAddress",
                        minWidth: 100,
                        align: "center"
                    }
                ],
                mainBaseInfo: {},
                mainWorkInfo: {},
                mainAddressList: [],
                maritalDic: [],
                commonAddressList: [],
                guaranAddressList: [],
                contactList: [],
                commomCustInfo: {},
                guarantorInfo: {},
                msgTemplate:{},
                msgModelVisible:false,
                msgModelLoading:false,
                initialized:false
            };
        },
        watch:{
            tabName(val){
                if(val=='name3' && !this.initialized){
                    this.init();
                    this.initialized = true;
                }
            }
        },
        methods:{
            /* 拨打电话
            *   注意：  mapMutations 需要从vuex引入 照着写就行。 //import { mapMutations } from "vuex";
            *  要变的是 传给软电话的数据
            */
            ...mapMutations(['updatePhoneParams']),
            // 打电话 调这个方法
            callPhone(phone,custRelation,custId,custName) {
                // 传给软电话的数据
                let params = {
                    isCallOut: true, //是否是一键拨打电话 必填
                    callNumber: phone,// 拨打的电话号码 必填
                    phone: phone,
                    applyNo: this.applyNo,
                    custRelation: custRelation,
                    custId: custId,
                    custName: custName
                    // ... // 其他 需要传给后台的参数
                }

                this.updatePhoneParams(params);
            },
            getZodiac(birthDay){
                let years = (new Date(birthDay).getFullYear() - 1960)%12 +2;
                return this.zodiacList[years];

            },
            initMaritalDic(){
                getDictDataByType("maritalStatus").then(res => {
                    if (res.code === "0000" && res.data) {
                        this.maritalDic = res.data;
                    }
                });
            },
            setMaritalStatusTitle(val){
                let dic = {}
                this.maritalDic.forEach(column => {
                    if(column.value === val){
                        dic = column;
                    }
                });
                return dic.title;
            },
            saveMainInfo(){
                if (this.mainBaseInfo.city ==="" || this.mainBaseInfo.city === undefined) {
                    this.$Message.error("请输入户籍地址")
                    return;
                }
                this.$refs.mainBaseInfo.validate(valid => {
                    if (valid) {
                        this.$Modal.confirm({
                            title: "保存基本信息",
                            content: "确认保存当前客户基本信息?",
                            onOk: () => {
                                let params = this.mainBaseInfo
                                saveMainInfo(params).then(res => {
                                    if (res.code === "0000") {
                                        this.$Message.success("保存成功");
                                        this.initMainBaseInfo();
                                    }else {
                                        this.$Message.error("保存失败");
                                    }
                                });
                            }
                        });
                    }
                })
            },
            saveCommomCustInfo(){
                if (this.commomCustInfo.city ==="" || this.commomCustInfo.city === undefined) {
                    this.$Message.error("请输入户籍地址")
                    return;
                }
                this.$refs.commomCustInfo.validate(valid => {
                    if (valid) {
                        this.$Modal.confirm({
                            title: "保存基本信息",
                            content: "确认保存当前客户基本信息?",
                            onOk: () => {
                                let params = this.commomCustInfo
                                saveCommomCustInfo(params).then(res => {
                                    if (res.code === "0000") {
                                        this.$Message.success("保存成功");
                                        this.initCommomCustInfo();
                                    }else {
                                        this.$Message.error("保存失败");
                                    }
                                });
                            }
                        });
                    }
                })
            },
            saveGuarantorInfo(){
                if (this.guarantorInfo.city ==="" || this.guarantorInfo.city === undefined) {
                    this.$Message.error("请输入户籍地址")
                    return;
                }
                this.$refs.guarantorInfo.validate(valid => {
                    if (valid) {
                        this.$Modal.confirm({
                            title: "保存基本信息",
                            content: "确认保存当前客户基本信息?",
                            onOk: () => {
                                let params = this.guarantorInfo
                                saveGuarantorInfo(params).then(res => {
                                    if (res.code === "0000") {
                                        this.$Message.success("保存成功");
                                        this.initGuarantorInfo();
                                    }else {
                                        this.$Message.error("保存失败");
                                    }
                                });
                            }
                        });
                    }
                })
            },
            saveWorkInfo(){
                this.$refs.mainWorkInfo.validate(valid =>{
                    if (valid) {
                        this.$Modal.confirm({
                            title: "保存工作信息",
                            content: "确定保存当前客户工作信息?",
                            onOk: () => {
                                if (this.mainWorkInfo.outstandingLoan === undefined || this.mainWorkInfo.outstandingLoan === ""){
                                    this.mainWorkInfo.outstandingLoan = 0
                                }
                                if (this.mainWorkInfo.familyIncome === undefined || this.mainWorkInfo.familyIncome === ""){
                                    this.mainWorkInfo.familyIncome = 0
                                }
                                let params = this.mainWorkInfo
                                saveWorkInfo(params).then(res =>{
                                    if (res.code === "0000") {
                                        this.$Message.success("保存成功");
                                        this.initMainWorkInfo();
                                    }else {
                                        this.$Message.error("保存失败");
                                    }
                                });
                            }
                        });
                    }
                })
            },
            saveCommonWorkInfo(){
                this.$refs.commomCustInfo.validate(valid =>{
                    if (valid) {
                        this.$Modal.confirm({
                            title: "保存工作信息",
                            content: "确定保存当前客户工作信息?",
                            onOk: () => {
                                if (this.commomCustInfo.outstandingLoan === undefined || this.commomCustInfo.outstandingLoan === ""){
                                    this.commomCustInfo.outstandingLoan = 0
                                }
                                if (this.commomCustInfo.familyIncome === undefined || this.commomCustInfo.familyIncome === ""){
                                    this.commomCustInfo.familyIncome = 0
                                }
                                let params = this.commomCustInfo
                                saveCommonWorkInfo(params).then(res =>{
                                    if (res.code === "0000") {
                                        this.$Message.success("保存成功");
                                        this.initCommomCustInfo();
                                    }else {
                                        this.$Message.error("保存失败");
                                    }
                                });
                            }
                        });
                    }
                })
            },
            saveGuarantorWorkInfo(){
                this.$refs.guarantorInfo.validate(valid =>{
                    if (valid) {
                        this.$Modal.confirm({
                            title: "保存工作信息",
                            content: "确定保存当前客户工作信息?",
                            onOk: () => {
                                if (this.guarantorInfo.outstandingLoan === undefined || this.guarantorInfo.outstandingLoan === ""){
                                    this.guarantorInfo.outstandingLoan = 0
                                }
                                if (this.guarantorInfo.familyIncome === undefined || this.guarantorInfo.familyIncome === ""){
                                    this.guarantorInfo.familyIncome = 0
                                }
                                let params = this.guarantorInfo
                                saveGuarantorWorkInfo(params).then(res =>{
                                    if (res.code === "0000") {
                                        this.$Message.success("保存成功");
                                        this.initGuarantorInfo()
                                    }else {
                                        this.$Message.error("保存失败");
                                    }
                                });
                            }
                        });
                    }
                })
            },
            changeAddress(){
                if (this.addressFrom.addressType == '3') {
                    this.addressFromValidate.houseType[0].required = false;
                    this.addressFromValidate.houseStartDate[0].required = false;
                }else {
                    this.addressFromValidate.houseType[0].required = true;
                    this.addressFromValidate.houseStartDate[0].required = true;
                }
            },
            getZodiacList(birthDay){
                let years = (new Date(birthDay).getFullYear() - 1960)%12 +2;
                let listTemp = this.zodiacList;
                return listTemp.slice(years-1,years+2);
            },
            //发送短信
            sendMsg() {
                this.$Modal.confirm({
                    title: ("发送短信"),
                    content: "确认发送?",
                    onOk: () => {
                        this.msgModelLoading = true;
                        sendMsg(this.msgTemplate).then(res=>{
                            this.$Message.info("操作成功！");
                        }).finally(()=>{
                            this.msgModelLoading = false;
                            this.closeMsg();
                        })
                    }
                });
            },
            getMsgTemp(name,phone,tempType){
                let params = {
                    name: name,
                    phone: phone,
                    applyNo: this.applyNo,
                    templateType: tempType
                }
                this.msgModelVisible = true;
                this.msgModelLoading = true;
                getMsgTempByType(params).then(res=>{
                    this.msgTemplate = res.data;
                    this.msgTemplate.name = name;
                    this.msgTemplate.phone = phone;
                    this.msgTemplate.applyNo = this.applyNo;
                }).finally(()=>{
                    this.msgModelLoading = false;
                })
            },
            closeMsg(){
                this.msgModelVisible = false;
            },
            addAddress(v) {
                this.addressModalType = 0;
                this.addressTitle = "新增地址";
                this.$refs.addressFrom.resetFields();
                this.addressVisible = true;

                switch (v) {
                    case 'main':
                        this.addressFrom.custId = this.mainBaseInfo.id;
                        break;
                    case 'common':
                        this.addressFrom.custId = this.commomCustInfo.id;
                        break;
                    case 'guaran':
                        this.addressFrom.custId = this.guarantorInfo.id;
                        break;
                }
            },
            cancelAddress() {
                this.addressVisible = false;
                this.$refs.addressFrom.resetFields();
            },
            submitAddress() {
                this.$refs.addressFrom.validate(valid => {
                    if (valid) {
                        saveAddress(this.addressFrom).then(res => {
                            if (res.code === "0000" && res.data) {
                                this.initMainAddressList();
                                this.initCommonAddressList();
                                this.initGuaranAddressList();
                                this.addressVisible = false;
                                this.$refs.addressFrom.resetFields();
                            }else{
                                this.$Message.error("地址新增失败，请重新操作");
                            }
                        });
                    }
                });
            },
            addContact() {
                this.contactModalType = 0;
                this.contactTitle = "新增联系人";
                this.$refs.contactFrom.resetFields();
                this.contactVisible = true;
                this.contactFrom.applyNo = this.applyNumber;
                this.contactFrom.custId = this.mainBaseInfo.id;
            },
            cancelContact() {
                this.contactVisible = false;
                this.$refs.contactFrom.resetFields();
                this.contactFromValidate.certType[0].required = false;
                this.contactFromValidate.certNo[0].required = false;
            },
            submitContact() {
                if (this.contactFrom.custRelation === "00006") {
                    this.contactFromValidate.certType[0].required = true;
                    this.contactFromValidate.certNo[0].required = true;
                }else {
                    this.contactFromValidate.certType[0].required = false;
                    this.contactFromValidate.certNo[0].required = false;
                }
                this.$refs.contactFrom.validate(valid => {
                    if (valid) {
                        var random_no = "";
                        for (var i = 0; i < 6; i++)
                        {
                            random_no += Math.floor(Math.random() * 10);
                        }
                        random_no = new Date().getTime() + random_no;
                            this.contactFrom.id = random_no
                        saveContact(this.contactFrom).then(res => {
                            if (res.code === "0000" && res.data) {
                                this.initContactList();
                                this.contactVisible = false;
                                this.$refs.contactFrom.resetFields();
                            }else{
                                this.$Message.error("联系人新增失败，请重新操作");
                            }
                        });
                    }
                });
            },
            removeContact(v) {
                this.$Modal.confirm({
                    title: "删除联系人信息",
                    content: "确认删除当前联系人信息?",
                    onOk: () => {
                        let params = {
                            contactId: v.id
                        }
                        removeContactById(params).then(res => {
                            if (res.code === "0000") {
                                if (res.msg === "success") {
                                    let params = {
                                        applyNo: this.applyNumber
                                    }
                                    queryContactList(params).then(res => {
                                        if (res.code === "0000" && res.data) {
                                            this.contactList = res.data;
                                        }
                                    });
                                    this.$Message['success']({
                                        background: true,
                                        content: '删除成功'
                                    });
                                } else {
                                    this.$Message['error']({
                                        background: true,
                                        content: '删除失败'
                                    });
                                }
                            }
                        });
                    }
                })
            },
            //删除客户地址信息
            removeAddress(v) {
                this.$Modal.confirm({
                    title: "删除地址信息",
                    content: "确认删除当前地址信息?",
                    onOk: () => {
                        let params = {
                            addressId: v.id
                        }
                        removeAddressById(params).then(res => {
                            if (res.code === "0000") {
                                if (res.msg === "success") {
                                    this.initMainAddressList();
                                    this.$Message['success']({
                                        background: true,
                                        content: '删除成功'
                                    });
                                } else {
                                    this.$Message['error']({
                                        background: true,
                                        content: '删除失败'
                                    });
                                }
                            }
                        });
                    }
                })
            },
            //删除共借人地址信息
            removeCommonAddress(v) {
                this.$Modal.confirm({
                    title: "删除地址信息",
                    content: "确认删除当前地址信息?",
                    onOk: () => {
                        let params = {
                            addressId: v.id
                        }
                        removeAddressById(params).then(res => {
                            if (res.code === "0000") {
                                if (res.msg === "success") {
                                    this.initCommonAddressList();
                                    this.$Message['success']({
                                        background: true,
                                        content: '删除成功'
                                    });
                                } else {
                                    this.$Message['error']({
                                        background: true,
                                        content: '删除失败'
                                    });
                                }
                            }
                        });
                    }
                })
            },
            //删除保证人地址信息
            removeGuaranAddress(v) {
                this.$Modal.confirm({
                    title: "删除地址信息",
                    content: "确认删除当前地址信息?",
                    onOk: () => {
                        let params = {
                            addressId: v.id
                        }
                        removeAddressById(params).then(res => {
                            if (res.code === "0000") {
                                if (res.msg === "success") {
                                    this.initGuaranAddressList();
                                    this.$Message['success']({
                                        background: true,
                                        content: '删除成功'
                                    });
                                } else {
                                    this.$Message['error']({
                                        background: true,
                                        content: '删除失败'
                                    });
                                }
                            }
                        });
                    }
                })
            },
            initDataDic(){
                let self = this;
                getByTypes(this.dicKeys).then(res => {
                    if (res.code === "0000" && res.data) {
                        self.dataDic = res.data;
                    }
                });
            },
            getDic(v){
                let dic = []
                switch(v) {
                    case "addressType":
                        dic = this.dataDic.addressType;
                        break;
                    case "houseType":
                        dic = this.dataDic.houseType;
                        break;
                    case "certType":
                        dic = this.dataDic.certType;
                        break;
                    case "custRelation":
                        dic = this.dataDic.custRelation;
                        break;
                    case "nationality":
                        dic = this.dataDic.nationality;
                        break;
                    default:
                }
                return dic;
            },
            setDictTitleByType(v1,v2){
                let dic = {}
                if(!this.getDic(v1)) return '';
                this.getDic(v1).forEach(column => {
                    if(column.value === v2){
                        dic = column;
                    }
                });
                return dic.title;
            },
            //查省份
            initQueryProvince() {
                let params = {
                    level: this.provinceLevel
                }
                getAddressList(params).then(res => {
                    if (res.code === "0000") {
                        this.provinces = res.data;
                    }
                });
            },
            //查城市
            queryCity(val){
                    let params = {
                        upperCode: val
                    }
                    getAddressList(params).then(res => {
                        if (res.code === "0000") {
                            this.cities = res.data;
                        }
                    });
            },
            queryMainCity(val){
                let params = {
                    upperCode: val
                }
                getAddressList(params).then(res => {
                    if (res.code === "0000") {
                        this.mainCities = res.data;
                    }
                });
            },
            queryCommonCity(val){
                let params = {
                    upperCode: val
                }
                getAddressList(params).then(res => {
                    if (res.code === "0000") {
                        this.commonCities = res.data;
                    }
                });
            },
            queryGuarantorCity(val){
                let params = {
                    upperCode: val
                }
                getAddressList(params).then(res => {
                    if (res.code === "0000") {
                        this.guarantorCities = res.data;
                    }
                });
            },
            initMainBaseInfo(){
                let params = {
                    applyNo: this.applyNumber
                }
                queryMainBaseInfo(params).then(res => {
                    if (res.code === "0000" && res.data) {
                        this.backSign=res.data.backSign;
                        this.mainBaseInfo = res.data;
                        this.queryMainCity(this.mainBaseInfo.province)
                        this.mainBaseInfo.zodiacList = this.getZodiacList(this.mainBaseInfo.birthday);
                        this.mainBaseInfo.zod = this.getZodiac(this.mainBaseInfo.birthday);
                    }
                });
            },
            initMainWorkInfo(){
                let params = {
                    applyNo: this.applyNumber
                }
                queryMainWorkInfo(params).then(res => {
                    if (res.code === "0000" && res.data) {
                        if (res.data.monthlyIncome !== undefined && res.data.monthlyIncome !== "") {
                            res.data.monthlyIncome = res.data.monthlyIncome.toString();
                        }else {
                            res.data.monthlyIncome = '0'
                        }
                        this.mainWorkInfo = res.data;
                    }
                });
            },
            initCommomCustInfo(){
                let params = {
                    applyNo: this.applyNumber,
                    custRole:"02"
                }
                queryCommomCustInfo(params).then(res => {
                    if (res.code === "0000" && res.data) {
                        if (res.data.monthlyIncome !== undefined && res.data.monthlyIncome !== "") {
                            res.data.monthlyIncome = res.data.monthlyIncome.toString();
                        }else {
                            res.data.monthlyIncome = '0'
                        }
                        this.commomCustInfo = res.data;
                        this.queryCommonCity(this.commomCustInfo.province);
                        this.commomCustInfo.zodiacList = this.getZodiacList(this.commomCustInfo.birthday);
                        this.commomCustInfo.zod = this.getZodiac(this.commomCustInfo.birthday);
                    }
                });
            },
            initGuarantorInfo(){
                let params = {
                    applyNo: this.applyNumber,
                    custRole:"03"
                }
                queryCommomCustInfo(params).then(res => {
                    if (res.code === "0000" && res.data) {
                        if (res.data.monthlyIncome !== undefined && res.data.monthlyIncome !== "") {
                            res.data.monthlyIncome = res.data.monthlyIncome.toString();
                        }else {
                            res.data.monthlyIncome = '0'
                        }
                        this.guarantorInfo = res.data;
                        this.queryGuarantorCity(this.guarantorInfo.province);
                        this.guarantorInfo.zodiacList = this.getZodiacList(this.guarantorInfo.birthday);
                        this.guarantorInfo.zod = this.getZodiac(this.guarantorInfo.birthday);
                    }
                });
            },
            initContactList(){
                let params = {
                    applyNo: this.applyNumber
                }
                queryContactList(params).then(res => {
                    if (res.code === "0000" && res.data) {
                        this.contactList = res.data;
                    }
                });
            },
            initMainAddressList(){
                let params = {
                    applyNo: this.applyNumber,
                    custRole:"01"
                }
                queryAddressList(params).then(res => {
                    if (res.code === "0000" && res.data) {
                        this.mainAddressList = res.data;
                    }
                });
            },
            initCommonAddressList(){
                let params = {
                    applyNo: this.applyNumber,
                    custRole:"02"
                }
                queryAddressList(params).then(res => {
                    if (res.code === "0000" && res.data) {
                        this.commonAddressList = res.data;
                    }
                });
            },
            initGuaranAddressList(){
                let params = {
                    applyNo: this.applyNumber,
                    custRole:"03"
                }
                queryAddressList(params).then(res => {
                    if (res.code === "0000" && res.data) {
                        this.guaranAddressList = res.data;
                    }
                });
            },
            initPageArea(){
                let params = {
                    applyNo: this.applyNumber
                }
                queryPageArea(params).then(res => {
                    if (res.code === "0000" && res.data) {
                        this.custShow = res.data;
                    }
                });
            },
            init() {
                this.initDataDic();
                this.initMainBaseInfo();
                this.initMainWorkInfo();
                this.initCommomCustInfo();
                this.initGuarantorInfo();
                this.initMainAddressList();
                this.initCommonAddressList();
                this.initGuaranAddressList();
                this.initContactList();
                this.initPageArea();
                this.initQueryProvince();
                this.initMaritalDic();
            },
        },
        mounted() {

        },
        created() {
            this.applyNumber = this.applyNo!=''?this.applyNo:this.afs.getPageParams(this).applyNo;
        }
    }
</script>
<style scoped>
</style>
